/**
 * Created by jerome.arnoult on 15/05/14.
 */
function gamenoid(id, life, tileposition, player){
    this.id = id;
    this.life = life;
    this.player = player;
    this.pathCoords;
    this.tileposition = tileposition;
    this.itemGave;
    this.situation;
    this.task;

    this.graphics;
    this.searchInterval;
}

gamenoid.prototype.spawn = function(x, y){
    var coords = game.gameMap.convertGridCoordsToPlacementCoords([x,y]);
    switch(this.tileposition){//Juste in case of superposition
        case 1:
            coords[1] = coords[1] - (game.gameMap.tileHeight*0.1);
            break;
        case 2:
            coords[0] = coords[0] + (game.gameMap.tileWidth*0.1);
            break;
        case 3:
            coords[1] = coords[1] + (game.gameMap.tileHeight*0.1);
            break;
        case 4:
            coords[0] = coords[0] - (game.gameMap.tileWidth*0.1);
            break;
    }
    this.graphics = game.gameRenderer.spawnNoid(coords[0], coords[1]);
    this.pathCoords = game.gameMap.convertGridCoordsToAStarCoords([x,y]);

    //this.searchInterval = setInterval(game.gameMap.)
}
gamenoid.prototype.die = function(){

}
gamenoid.prototype.searchTask = function(){

}
